// axios 的封装处理
import axios from "axios"
import * as http from "node:http";
//1、根域名配置
//2、超时时间
const request = axios.create({
    baseURL: 'http://geek.itheima.net./v1.0',
    timeout: 5000,
    connectTimeout: 10000,
})
//3、请求拦截 / 响应拦截器
request.interceptors.request.use(config => {
    return config
}, (error) => {
    return Promise.reject(error);
})


request.interceptors.response.use((response) => {
    return response;
}, (error) => {
    return Promise.reject(error);
})

export {request};